<?php
class Application_Plugin_AccessCheck extends Zend_Controller_Plugin_Abstract {
    
   // private $_acl = null;
    
    public function __construct() {
   //     $this->_acl = $acl;
       }
    
    //public function preDispatch(Zend_Controller_Request_Abstract $request) {
    public function preDispatch(Zend_Controller_Request_Abstract $request) {

        $regLogin = Zend_Registry::get('login');
        $module = $request->getModuleName();
        $resource = $request->getControllerName();
        $action = $request->getActionName();

        echo"<br>my-project-gn: ";
        echo"<br>module: ";var_dump($module);
        echo"<br>controllador: ";var_dump($resource);
        echo"<br>accion: ";var_dump($action);//die();
      
        if(!isset($regLogin->rg_usuario)){
        
        $request->setModuleName('user')
                ->setControllerName('users')
                ->setActionName('login');
        //echo"<br>spreDispatch: ";
        echo"<br>request: "; //var_dump($request);//die();
        }

             
    }
}
